import { defineStore } from "pinia";

export default defineStore("counter", {
  state: () => {
    return {
      count: 2
    }
  },
  getters: {
    double(): number {
      return this.count * 2
    },
  },
  actions: {
    increment(): void {
      this.count++
    },
    randomizeCounter(): void {
      this.count = Math.round(100 * Math.random())
    },
  },
});